﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Styx.Helpers;
using Styx.WoWInternals;

namespace FelMaster.ClassButton
{
    public class SettingsFile : Styx.Helpers.Settings
    {
        private static SettingsFile instance = new SettingsFile();
        public static SettingsFile Instance
        {
            get
            {
                return instance;
            }
        }

        private SettingsFile()
            : base("./Settings/FelMaster_"+ObjectManager.Me.Name+".xml")
        {
            this.Load();
        }

        public bool CurrentMode_HandleMovement
        {
            get
            {
                switch (GroupBase.Instance.Logic)
                {
                    case GroupBase.GroupLogic.BATTLEGROUND:
                        return Battleground_HandleMovement;

                    case GroupBase.GroupLogic.PVE:
                        switch (GroupBase.Instance.Group)
                        {
                            case GroupBase.GroupType.PARTY:
                            case GroupBase.GroupType.RAID:
                                return Party_HandleMovement;

                            case GroupBase.GroupType.SINGLE:
                                return Single_HandleMovement;

                            default:
                                return false;
                        }

                    default:
                        return false;
                }
            }
        }
        public bool CurrentMode_HandleCooldowns
        {
            get
            {
                switch (GroupBase.Instance.Logic)
                {
                    case GroupBase.GroupLogic.BATTLEGROUND:
                        return Battleground_HandleBurstCooldowns;

                    case GroupBase.GroupLogic.PVE:
                        switch (GroupBase.Instance.Group)
                        {
                            case GroupBase.GroupType.PARTY:
                            case GroupBase.GroupType.RAID:
                                return Party_HandleBurstCooldowns;

                            case GroupBase.GroupType.SINGLE:
                                return Single_HandleBurstCooldowns;

                            default:
                                return false;
                        }

                    default:
                        return false;
                }
            }
        }

        [Setting]
        [DefaultValue(false)]
        public bool Single_HandleMovement { get; set; }

        [Setting]
        [DefaultValue(true)]
        public bool Single_HandleBurstCooldowns { get; set; }

        [Setting]
        [DefaultValue(false)]
        public bool Party_HandleMovement { get; set; }

        [Setting]
        [DefaultValue(true)]
        public bool Party_HandleBurstCooldowns { get; set; }

        [Setting]
        [DefaultValue(false)]
        public bool Battleground_HandleMovement { get; set; }

        [Setting]
        [DefaultValue(true)]
        public bool Battleground_HandleBurstCooldowns { get; set; }
    }
}
